package com.chartboost.sdk.impl;

import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.net.Uri;
import com.chartboost.sdk.Chartboost;
import com.chartboost.sdk.b.a;
import com.chartboost.sdk.b.b;
import com.chartboost.sdk.b.c;
import java.util.Date;
import java.util.List;
import org.json.JSONObject;

public class a
{
  public JSONObject a;
  public Date b;
  public b c;
  public c d;
  public String e;
  public com.chartboost.sdk.b f;
  public a g;
  public s h;
  public boolean i;
  public boolean j;
  public boolean k;

  public a(JSONObject paramJSONObject, c paramc, a parama, b paramb, String paramString)
  {
    if (paramJSONObject == null)
      paramJSONObject = new JSONObject();
    this.c = paramb;
    this.e = paramString;
    this.a = paramJSONObject;
    this.b = new Date();
    this.g = parama;
    this.d = paramc;
    this.i = false;
    this.j = false;
    this.k = false;
    boolean bool = paramJSONObject.optString("type", "").equals("native");
    if ((bool) && (this.d == c.b))
      this.f = new b(this);
    while (true)
    {
      this.f.c = new b.a()
      {
        public void a()
        {
          if (jdField_this.g != null)
            jdField_this.g.a(jdField_this);
        }
      };
      this.f.a = new b.a()
      {
        public void a()
        {
          if (jdField_this.g != null)
            jdField_this.g.b(jdField_this);
        }
      };
      this.f.b = new b.c()
      {
        public void a(String paramAnonymousString, JSONObject paramAnonymousJSONObject)
        {
          if (paramAnonymousString != null);
          while (true)
          {
            String str = jdField_this.a.optString("deep-link");
            if ((str != null) && (!str.equals("")));
            try
            {
              Intent localIntent = new Intent("android.intent.action.VIEW", Uri.parse(str));
              int i = Chartboost.sharedChartboost().getContext().getPackageManager().queryIntentActivities(localIntent, 65536).size();
              if (i > 0)
                paramAnonymousString = str;
              label75: jdField_this.g.a(jdField_this, paramAnonymousString, paramAnonymousJSONObject);
              return;
              paramAnonymousString = jdField_this.a.optString("link");
            }
            catch (Exception localException)
            {
              break label75;
            }
          }
        }
      };
      this.f.d = new b.a()
      {
        public void a()
        {
          jdField_this.g.c(jdField_this);
        }
      };
      this.f.a(paramJSONObject);
      return;
      if ((bool) && (this.d == c.c))
        this.f = new h(this);
      else
        this.f = new v(this);
    }
  }

  public boolean a()
  {
    this.i = true;
    this.j = true;
    this.k = true;
    this.f.a();
    if (this.f.d() != null)
      return true;
    this.i = false;
    this.j = false;
    this.k = false;
    return false;
  }

  public void b()
  {
    if (this.h != null)
      this.h.a();
    try
    {
      if (this.f.d().getParent() != null)
        this.h.removeView(this.f.d());
      label41: if (this.f != null)
        this.f.c();
      this.a = null;
      this.b = null;
      this.g = null;
      this.f = null;
      this.h = null;
      return;
    }
    catch (Exception localException)
    {
      break label41;
    }
  }

  public void c()
  {
    if (this.h != null)
      this.h.a();
    try
    {
      if (this.f.d().getParent() != null)
        this.h.removeView(this.f.d());
      label41: if (this.f != null)
        this.f.e();
      return;
    }
    catch (Exception localException)
    {
      break label41;
    }
  }

  public static abstract interface a
  {
    public abstract void a(a parama);

    public abstract void a(a parama, String paramString, JSONObject paramJSONObject);

    public abstract void b(a parama);

    public abstract void c(a parama);
  }

  public static enum b
  {
    static
    {
      b[] arrayOfb = new b[6];
      arrayOfb[0] = a;
      arrayOfb[1] = b;
      arrayOfb[2] = c;
      arrayOfb[3] = d;
      arrayOfb[4] = e;
      arrayOfb[5] = f;
    }
  }

  public static enum c
  {
    static
    {
      c[] arrayOfc = new c[3];
      arrayOfc[0] = a;
      arrayOfc[1] = b;
      arrayOfc[2] = c;
    }
  }
}

/* Location:           E:\android\Toy Defense 2_dex2jar.jar
 * Qualified Name:     com.chartboost.sdk.impl.a
 * JD-Core Version:    0.6.2
 */